<me:UISTKCHG x:Class="WPFExcelReport.TGSTKCHG"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
             xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
             xmlns:me="clr-namespace:WPFExcelReport" 
             xmlns:Localization="clr-namespace:Localization;assembly=Localization"                    
             x:Name="TV"
             Loaded="Window_Loaded"
     >
    <me:UISTKCHG.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby10000  x:Key="dw"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UISTKCHG.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0*"/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <DataGrid CanUserReorderColumns="True" 
             Grid.Row="0" 
             CanUserResizeRows="True" 
             CanUserSortColumns="True" 
             AutoGenerateColumns="False" 
             EnableRowVirtualization="True" 
             HorizontalAlignment="Stretch" 
             VerticalAlignment="Stretch"
             IsSynchronizedWithCurrentItem="True"  
                  IsReadOnly="True"
             ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
             Name="dlgMaster"
             Margin="0,1,0.2,0.4"  Grid.ColumnSpan="3" >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=MDATE}" Header="{Binding Source={Localization:TranslateExtension Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LO}" Header="{Binding Source={Localization:TranslateExtension Word=LO}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LB}" Header="{Binding Source={Localization:TranslateExtension Word=LB}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=FARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS}" Header="{Binding Source={Localization:TranslateExtension Word=BS}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BSDES,Converter={StaticResource gb2312}}"  Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BSQTY}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <WrapPanel Grid.Row="1" Grid.ColumnSpan="3" Margin="0,26,0.2,0.4">
            <WrapPanel >
                <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            </WrapPanel>
        </WrapPanel>
    </Grid>
</me:UISTKCHG>
